<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="inp">
    <script>

        // 封装一个函数，实现99乘法表   ---   没有返回值   --- 只能在页面输出

        function print99(n) {
            for(var i = 1;  i <= n ; i++) {
                for(var j = 1 ; j <= i ; j++) {
                    document.write(j + '*' + i + '=' + i * j + ' ') ;
                }
                document.write('<br>')
            }
        }

        print99(4)





        // function sum(a , b) {
        //     document.write(a + b) ;    /// 永远只会在文档中写入  
        // }


        // sum(1 , 2) ;


        // 万一需要放在框里面？

        function sum(a , b) {
            return a + b 
        }



        var oInp = document.getElementById('inp') ;
        oInp.value = sum(1 , 2) ;


        document.write(sum(1,2)) ;
        

        
    </script>
    
</body>
</html>